"""
@File    :   models.py
@Contact :
@Modify Time      @Author    @Version    @Desciption
------------      -------    --------    -----------
2021/2/18 16:27   ypy      1.0           定义phase_data，note_date，reward_conditions
"""

from django.db import models


# Create your models here.
class phase_data(models.Model):
    """
        大乐透开奖表
        描述：记录期号、日期、开奖红篮球，当期销售额，一等奖，二等奖信息，总奖池
    """
    phasenum = models.fields.TextField(verbose_name='期号', max_length=10)
    date = models.fields.TextField(verbose_name='日期', max_length=10)
    red1 = models.fields.IntegerField(verbose_name='红球1')
    red2 = models.fields.IntegerField(verbose_name='红球2')
    red3 = models.fields.IntegerField(verbose_name='红球3')
    red4 = models.fields.IntegerField(verbose_name='红球4')
    red5 = models.fields.IntegerField(verbose_name='红球5')
    blue1 = models.fields.IntegerField(verbose_name='蓝球1')
    blue2 = models.fields.IntegerField(verbose_name='蓝球2')
    jackpot = models.fields.TextField(verbose_name='销售额', max_length=20)
    firstnum = models.fields.TextField(verbose_name='一等奖注数', max_length=20)
    firstprice = models.fields.TextField(verbose_name='一等奖奖金', max_length=20)
    secondnum = models.fields.TextField(verbose_name='二等奖注数', max_length=20)
    secondprice = models.fields.TextField(verbose_name='二等奖奖金', max_length=20)
    totalbet = models.fields.TextField(verbose_name='奖池', max_length=20)

    # class Meta:
    #     db_table = 'stock_basic'  # 通过db_table自定义数据表名,而不会添加app前缀


class bet_data(models.Model):
    """
            投注信息表
            描述：投注期数，红篮球，中奖级数，是否中奖，投注倍数
    """
    phasenum = models.fields.TextField(verbose_name='期号', max_length=10)
    red1 = models.fields.IntegerField(verbose_name='红球1')
    red2 = models.fields.IntegerField(verbose_name='红球2')
    red3 = models.fields.IntegerField(verbose_name='红球3')
    red4 = models.fields.IntegerField(verbose_name='红球4')
    red5 = models.fields.IntegerField(verbose_name='红球5')
    blue1 = models.fields.IntegerField(verbose_name='蓝球1')
    blue2 = models.fields.IntegerField(verbose_name='蓝球2')
    bonuslevel = models.fields.TextField(verbose_name='中奖等级', max_length=10, default='等待开奖')  # 从一等将至未中奖
    ischeck = models.fields.BooleanField(verbose_name='是否已检测', default=False)  # 是否检测过该投注是否中奖
    multiple = models.fields.IntegerField(verbose_name='投注倍数', default=1)
    bonusprice = models.fields.TextField(verbose_name='中奖金额', max_length=20, default='0')
    additonal_bet = models.fields.BooleanField(verbose_name='追加投注', default=False)


class reward_conditions(models.Model):
    """
            奖励信息表
            描述：奖励等级，投中红球数，投中篮球数，单倍奖金数
    """
    bonuslevel = models.fields.TextField(verbose_name='奖励等级', max_length=10)
    red = models.fields.IntegerField(verbose_name='投中红球数')
    blue = models.fields.IntegerField(verbose_name='投中篮球数')
    single_bonus = models.fields.TextField(verbose_name='单倍奖金数', max_length=10)
